//package com.example.buhui;
//
//
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.example.buhui.dao.EmployeeMapper;
//import com.example.buhui.entity.Employee;
//import com.example.buhui.entity.User;
//import org.junit.Test;
//import org.junit.runner.RunWith;
//import org.springframework.boot.test.context.SpringBootTest;
//import org.springframework.test.context.junit4.SpringRunner;
//
//import javax.annotation.Resource;
//import java.util.*;
//
//@RunWith(SpringRunner.class)
//@SpringBootTest
//public class BuhuiApplicationTests2 {
//    @Resource
//    private EmployeeMapper employeeMapper;
//    @Test
//    public void tsetInsert() {
////
////        List<Employee> list = employeeMapper.selectList(null);
////        for (Employee user : list
////        ) {
////            System.out.println(user);
////        }
//
////        Employee emp = new Employee();
////        emp.setAge(20);
////        emp.setEmail("4654@qq.com");
////        emp.setGender(1);
////        emp.setUserName("大老李");
////        emp.setId(12);
////        int count = employeeMapper.insert(emp);
////        if (count > 0) {
////            System.out.println("增加成功");
////        } else {
////            System.out.println("增加失败");
////        }
////
////        }
////        @Test
////        public void tsetDelect() {
////            int del = this.employeeMapper.deleteById(5);
////            if (del > 0) {
////                System.out.println("删除成功");
////            }else {
////                System.out.println("删除失败");
////            }
//        //       效果与上面相同 构造对象
////        Map<String, Object> map = new HashMap<>();
////        map.put("id",5);
////          //id可以用user_name，age等表中列名代替
////        int del1 = this.employeeMapper.deleteByMap(map);
////        if (del > 0) {
////            System.out.println("删除成功");
////        }else {
////            System.out.println("删除失败");
////        }
////        //      创建条件构造器
////        QueryWrapper<Employee> wrapper = new QueryWrapper<>();
////        //      制定删除条件
////        wrapper.eq("id",3);
//
////        //      批量删除
////        List<Integer> idList = new ArrayList<>();
////        idList.add(7);
////        idList.add(8);
////        idList.add(9);
////        int del3 = this.employeeMapper.deleteBatchIds(idList);
////        if (del > 0) {
////            System.out.println("删除成功");
////        }else {
////            System.out.println("删除失败");
////        }
////        }
////    @Test
////    public void tsetUpdata() {
////
////        Employee emp = new Employee();
////        emp.setEmail("2333@qq.233");
////        emp.setGender(0);
////        emp.setId(6);
////        int count = this.employeeMapper.updateById(emp);
////        if (count > 0) {
////            System.out.println("修改成功");
////        } else {
////            System.out.println("修改失败");
////        }
////            //创建条件构造器
////        QueryWrapper<Employee> updata02 = new QueryWrapper<>();
////        updata02.eq("id", 5);//这为指定条件语句，如果不指定默认全修改
////        emp.setAge(100);
////        int updata = this.employeeMapper.updateById(emp);
////        if (updata > 0) {
////            System.out.println("修改成功");
////        } else {
////            System.out.println("修改失败");
////        }
////    }
//    }
//
//}
//
